-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expression builder v2 #565
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phenomenal stuff! 🙇
This is definitely a step in the right direction, removing the noise of cmpr
and bxp
, and adding the on-the-fly or
/and
chaining.
And all the deprecated code being deleted, music to my ears!! 😃
A small concern might be the addition of DB
and TB
to ExpressionWrapper
's interface, and how it will affect consumers who make their own helpers. Is it still as flexible as before? I guess we'll find out and adjust if there are issues.
I'll do another pass tomorrow morning, it's late and I fear I missed some stuff.
I don't think |
62b770b
to
ee589b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LET'S GO! 🚀
This commit also removes the deprecated filter methods. It wasn't possible to keep them and have the combined expression builder + query builder monster be callable.
Co-authored-by: Igal Klebanov <[email protected]>
Co-authored-by: Igal Klebanov <[email protected]>
Co-authored-by: Igal Klebanov <[email protected]>
7eb9e03
to
b83266e
Compare
* Make expression builder callable. This commit also removes the deprecated filter methods. It wasn't possible to keep them and have the combined expression builder + query builder monster be callable. * Add chainable ands and ors to expression builder * Update src/expression/expression-builder.ts Co-authored-by: Igal Klebanov <[email protected]> * Update src/expression/expression-wrapper.ts Co-authored-by: Igal Klebanov <[email protected]> * Update src/expression/expression-wrapper.ts Co-authored-by: Igal Klebanov <[email protected]> * fix confusing join expression test * consistent language --------- Co-authored-by: Igal Klebanov <[email protected]>
This PR deprecates the
cmpr
andbxp
functions and makes theExpressionBuilder
callable.eb
can now be used to create all sorts of binary expressions. I didn't change the site examples yet, or otherwise they would be broken until we release this.This PR also removes the deprecated
orWhere
,whereExits
etc. methods. It might be a bit early to do that, but didn't find a way to make the expression builder callable while they existed.The second commit introduces an alternative way to create
and
andor
expressions. The old way is still there and won't be removed or deprecated. Some people prefer that one and it's (at least currently) much easier to create conditionalor
-expressions using theor([expr1, expr2])
function.These changes now make simple
or
statements fluent and arguably more readable:VS
You can still destructure
eb
.eb
contains a propertyeb
that refers to itself:closes #494